{extend name='public/bass' /}


{block name="meta"}{/block}

{block name="css"}{/block}

{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row" style="margin-bottom: 5px">
        <div class="col-sm-12 text-right">
            <a href="{:url('/admin/art/create')}" class="btn btn-primary ">添加文章</a>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">

            <div class="ibox float-e-margins">

                <div class="ibox-content">

                    <table class="table">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>栏目</th>
                            <th>标题</th>
                            <th>发布时间</th>
                            <th> 选 项</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach $res as $item}
                        <tr>
                            <td>{$item.id}</td>
                            <td>{$item->cate['cate_name']}</td>
                            <td>{$item.title}</td>
                            <td>{$item.create_time|date='Y-m-d H:i'}</td>
                            <td>
                                <a href="/admin/art/{$item.id}/edit">修改</a>|
                                <a class="delart" href="/admin/art/{$item.id}">删除</a>
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>

                </div>
                <div class="row">
                    <div class="col-sm-12 text-center">
                        <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                            {$res|raw}

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
{/block}
{block name='js'}
<script>
    $('.delart').click(function () {
        // var url = $(this).attr('href');
        $.ajax({
            url:'/admin/art/76',
            type:'delete',
            success:function (res) {
                console.log(res);
            }
        });

        return false;
    });
</script>
{/block}

